class Solution:
    def areaOfMaxDiagonal(self, dimensions: List[List[int]]) -> int:
        res = [0, 0]
        for x in dimensions:
            digl = pow(x[0] * x[0] + x[1] * x[1], 0.5)
            area = x[0] * x[1]
            if digl > res[0]:
                res[0] = digl
                res[1] = area
            elif digl == res[0]:
                if area > res[1]:
                    res[1] = area
        return res[1]